package com.eva.androidlibrary.api.entity;

import android.os.Parcel;
import android.os.Parcelable;

import com.alibaba.fastjson.annotation.JSONField;

/**
 * Created by eva on 15/11/16.
 */
public class OrderInfo extends BaseBean implements Parcelable {

    /**
     * 订单状态：未知
     */
    public static final int STATUS_UNKNOWN = 0;
    /**
     * 订单状态：待处理
     */
    public static final int STATUS_TODO = 1;
    /**
     * 订单状态：处理中
     */
    public static final int STATUS_DOING = 2;
    /**
     * 订单状态：已完成
     */
    public static final int STATUS_DONE = 3;
    /**
     * 订单状态：退订
     */
    public static final int STATUS_CANCEL = 4;

    /**
     * 称重
     */
    public static final int DOING_PROGRESS_WEIGHT = 1;
    /**
     * 发布配送
     */
    public static final int DOING_PROGRESS_PUBLISH = 2;
    /**
     * 催配送
     */
    public static final int DOING_PROGRESS_RUSH = 3;

    /**
     * 正在处理的订单类型：立即送
     */
    public static final int TYPE_IMMEDIATELY = 1;
    /**
     * 正在处理的订单类型：按时达
     */
    public static final int TYPE_ON_TIME = 2;

    public OrderInfo() {
    }

    /**
     * 订单号
     */
    private String orderSN;

    /**
     * 用户id
     */
    private String uuid;

    /**
     * 店铺id
     */
    @JSONField(name = "shopid")
    private String shopId;

    /**
     * 配送时间
     */
    @JSONField(name = "delivery_time")
    private String deliveryTime;

    /**
     * 订单完成时间
     */
    @JSONField(name = "order_finish_time")
    private String orderFinishTime;

    /**
     * ?
     */
    @JSONField(name = "order_time")
    private double orderTime;

    /**
     * 订单总价
     */
    private int price;

    /**
     * 配送价格
     */
    @JSONField(name = "ps_price")
    private int deliveryPrice;

    /**
     * ?
     */
    @JSONField(name = "zf_price")
    private int RealPayPrice;

    /**
     * 优惠价格
     */
    @JSONField(name = "coupon_price")
    private int couponPrice;

    /**
     * 付款方式代号: 0未选择支付方式,1货到付款,2支付宝支付,3微信支付
     */
    @JSONField(name = "pay_type")
    private int payType;

    /**
     * 付款方式中文名称,货到付款,支付宝支付,微信支付
     */
    @JSONField(name = "pay_name")
    private String payName;

    /**
     * 支付状态,0未支付,1支付成功,2支付失败
     */
    @JSONField(name = "is_pay")
    private int isPay;

    /**
     * 评价状态,0未知是否要评论,1待评论,2评论完成
     */
    @JSONField(name = "is_evaluate")
    private int isEvaluate;

    /**
     * ?
     */
    @JSONField(name = "is_return")
    private int isReturn;

    /**
     * 发货状态,0未知是否要发货,1待发货,2已发货,3确认收货
     */
    @JSONField(name = "send_status")
    private int sendStatus;

    /**
     * 收货状态，
     */
    @JSONField(name = "receive_status")
    private int receiveStatus;

    /**
     * 称重状态，
     */
    @JSONField(name = "weigh_status")
    private int weightStatus;

    /**
     * 交易类型,1待接单,2进行中的订单,3已完成订单
     */
    private int type;

    private int status;

    /** 收货人姓名 */
    @JSONField(name = "receiver_name")
    private String userName;

    /** 收货人联系电话 */
    @JSONField(name = "receiver_phone")
    private String userMobile;

    /** 收货地址 */
    @JSONField(name = "receiver_address")
    private String receiverAddress;

    @JSONField(name = "receiver_intro")
    private String receiverIntro;

    /** 用户头像 */
    private String avatar;

    /** ? */
    private int balance;

    @JSONField(name = "created_at")
    private float createdAt;

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public String getReceiverAddress() {
        return receiverAddress;
    }

    public void setReceiverAddress(String receiverAddress) {
        this.receiverAddress = receiverAddress;
    }

    public String getAvatar() {
        return avatar;
    }

    public void setAvatar(String avatar) {
        this.avatar = avatar;
    }

    public String getOrderSN() {
        return orderSN;
    }

    public void setOrderSN(String orderSN) {
        this.orderSN = orderSN;
    }

    public String getUuid() {
        return uuid;
    }

    public void setUuid(String uuid) {
        this.uuid = uuid;
    }

    public String getShopId() {
        return shopId;
    }

    public void setShopId(String shopId) {
        this.shopId = shopId;
    }

    public String getDeliveryTime() {
        return deliveryTime;
    }

    public void setDeliveryTime(String deliveryTime) {
        this.deliveryTime = deliveryTime;
    }

    public String getOrderFinishTime() {
        return orderFinishTime;
    }

    public void setOrderFinishTime(String orderFinishTime) {
        this.orderFinishTime = orderFinishTime;
    }

    public double getOrderTime() {
        return orderTime;
    }

    public void setOrderTime(double orderTime) {
        this.orderTime = orderTime;
    }

    public int getPrice() {
        return price;
    }

    public void setPrice(int price) {
        this.price = price;
    }

    public int getDeliveryPrice() {
        return deliveryPrice;
    }

    public void setDeliveryPrice(int deliveryPrice) {
        this.deliveryPrice = deliveryPrice;
    }

    public int getRealPayPrice() {
        return RealPayPrice;
    }

    public void setRealPayPrice(int realPayPrice) {
        RealPayPrice = realPayPrice;
    }

    public int getCouponPrice() {
        return couponPrice;
    }

    public void setCouponPrice(int couponPrice) {
        this.couponPrice = couponPrice;
    }

    public int getPayType() {
        return payType;
    }

    public void setPayType(int payType) {
        this.payType = payType;
    }

    public String getPayName() {
        return payName;
    }

    public void setPayName(String payName) {
        this.payName = payName;
    }

    public int getIsPay() {
        return isPay;
    }

    public void setIsPay(int isPay) {
        this.isPay = isPay;
    }

    public int getIsEvaluate() {
        return isEvaluate;
    }

    public void setIsEvaluate(int isEvaluate) {
        this.isEvaluate = isEvaluate;
    }

    public int getIsReturn() {
        return isReturn;
    }

    public void setIsReturn(int isReturn) {
        this.isReturn = isReturn;
    }

    public int getSendStatus() {
        return sendStatus;
    }

    public void setSendStatus(int sendStatus) {
        this.sendStatus = sendStatus;
    }

    public int getReceiveStatus() {
        return receiveStatus;
    }

    public void setReceiveStatus(int receiveStatus) {
        this.receiveStatus = receiveStatus;
    }

    public int getWeightStatus() {
        return weightStatus;
    }

    public void setWeightStatus(int weightStatus) {
        this.weightStatus = weightStatus;
    }

    public int getType() {
        return type;
    }

    public void setType(int type) {
        this.type = type;
    }

    public int getStatus() {
        return status;
    }

    public void setStatus(int status) {
        this.status = status;
    }

    public String getUserMobile() {
        return userMobile;
    }

    public void setUserMobile(String userMobile) {
        this.userMobile = userMobile;
    }

    public String getReceiverIntro() {
        return receiverIntro;
    }

    public void setReceiverIntro(String receiverIntro) {
        this.receiverIntro = receiverIntro;
    }

    public int getBalance() {
        return balance;
    }

    public void setBalance(int balance) {
        this.balance = balance;
    }

    public float getCreatedAt() {
        return createdAt;
    }

    public void setCreatedAt(float createdAt) {
        this.createdAt = createdAt;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(this.orderSN);
        dest.writeString(this.uuid);
        dest.writeString(this.shopId);
        dest.writeString(this.deliveryTime);
        dest.writeString(this.orderFinishTime);
        dest.writeDouble(this.orderTime);
        dest.writeInt(this.price);
        dest.writeInt(this.deliveryPrice);
        dest.writeInt(this.RealPayPrice);
        dest.writeInt(this.couponPrice);
        dest.writeInt(this.payType);
        dest.writeString(this.payName);
        dest.writeInt(this.isPay);
        dest.writeInt(this.isEvaluate);
        dest.writeInt(this.isReturn);
        dest.writeInt(this.sendStatus);
        dest.writeInt(this.receiveStatus);
        dest.writeInt(this.weightStatus);
        dest.writeInt(this.type);
        dest.writeInt(this.status);
        dest.writeString(this.userName);
        dest.writeString(this.receiverAddress);
        dest.writeString(this.avatar);
    }

    protected OrderInfo(Parcel in) {
        this.orderSN = in.readString();
        this.uuid = in.readString();
        this.shopId = in.readString();
        this.deliveryTime = in.readString();
        this.orderFinishTime = in.readString();
        this.orderTime = in.readDouble();
        this.price = in.readInt();
        this.deliveryPrice = in.readInt();
        this.RealPayPrice = in.readInt();
        this.couponPrice = in.readInt();
        this.payType = in.readInt();
        this.payName = in.readString();
        this.isPay = in.readInt();
        this.isEvaluate = in.readInt();
        this.isReturn = in.readInt();
        this.sendStatus = in.readInt();
        this.receiveStatus = in.readInt();
        this.weightStatus = in.readInt();
        this.type = in.readInt();
        this.status = in.readInt();
        this.userName = in.readString();
        this.receiverAddress = in.readString();
        this.avatar = in.readString();
    }

    public static final Parcelable.Creator<OrderInfo> CREATOR = new Parcelable.Creator<OrderInfo>() {
        public OrderInfo createFromParcel(Parcel source) {
            return new OrderInfo(source);
        }

        public OrderInfo[] newArray(int size) {
            return new OrderInfo[size];
        }
    };
}